/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.member;

import com.enation.app.javashop.client.member.MemberAddressClient;
import com.enation.app.javashop.core.client.fallback.member.MemberAddressClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.member.dos.MemberAddress;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 会员地址feignt实现
 *
 * @author zh
 * @version v7.0
 * @date 18/7/31 下午4:43
 * @since v7.0
 */
@FeignClient(name = "member-service", fallbackFactory = MemberAddressClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface MemberAddressClientFeigntImpl extends MemberAddressClient {

    /**
     * 获取一个地址
     *
     * @param id 会员地址主键
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/member-address/{id}", method = RequestMethod.GET)
    MemberAddress getModel(@PathVariable("id") Long id);

    /**
     * 获取某会员的默认地址
     *
     * @param memberId 会员id
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/member-address/{member_id}/default", method = RequestMethod.GET)
    MemberAddress getDefaultAddress(@PathVariable("member_id") Long memberId);

}
